﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcApplication1.Models.Noticia>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    
    <h2>Noticias</h2>


    <% foreach (var item in Model) { %> 

         <h3><%: Html.ActionLink(item.Titulo, "Details", new { id = item.IDNoticias })%></h3>

         <h4><%: Html.Label(item.Bajada) %></h4>
         
            <% if (ViewData["Usuario"].Equals("admin"))
           { %>
             <h5>
                ( <%: Html.ActionLink("Editar", "Edit", new { id = item.IDNoticias })%> |
                <%: Html.ActionLink("Borrar", "Delete", new { id = item.IDNoticias })%> )
             </h5>
            <%} %>


         <p>
           ------------------------------------------------
         </p>
    <% } %>

    <p>
        <% if (ViewData["Usuario"].Equals("admin"))
        { %>
            <%: Html.ActionLink("Crear Noticia", "Create")%>
        <%} %>
    </p>

</asp:Content>

